const http = require("http");
const url = require("url");
const server = http.createServer();
server.on("request", (req, res) => {
  let { pathname } = url.parse(req.url);
  let { query } = url.parse(req.url, true);
  let path = url.parse(req.url);
  // let { query } = url.parse(req.url);
  // let pathname = req.url;
  // res.end(query);
  console.log(path);
  console.log(query.name);
  console.log(pathname);
  // res.end(pathname);
});
server.listen(3000, () => {
  console.log("server is running");
});
